#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

/**
 * Main exo1
 */
int main(int argc, char* argv[]) {

	question1();
	question2();
	return EXIT_SUCCESS;
}

void question1() {
	int pid = fork();
	switch (pid) {
	// En cas d'erreur.
	case -1:
		perror("Erreur Process père");
		break;
	case 0:
		// Le fils.
		printf(
				"Le fils : ID du processus = %d \t ID process père = %d \t user = %d \t effective user = %d \t real group = %d \t effective group = %d\n",
				getpid(), getppid(), getuid(), geteuid(), getgid(), getegid());
		break;
	default:
		// Le père.
		printf(
				"Le père : ID du processus = %d \t ID process père = %d \t user = %d \t effective user = %d \t real group = %d \t effective group = %d\n",
				getpid(), getppid(), getuid(), geteuid(), getgid(), getegid());
		break;
		break;
	}
}

void question2() {

}
